-- Crappy coding but it works just fine.
-- Plays the soundfile even if your sound effects are disabled (Master channel).
-- Have fun but don't tab too much.

local frame, events = CreateFrame("Frame", "wake_up"), {};

-- #######################################################
-- start of events
-- #######################################################

-- party invite
function events:PARTY_INVITE_REQUEST(...)
 PlaySoundFile("Interface\\AddOns\\wake_up\\wake_up.ogg", "Master")
end

-- going to queue into lfg
function events:LFG_ROLE_CHECK_SHOW(...)
 PlaySoundFile("Interface\\AddOns\\wake_up\\wake_up.ogg", "Master")
end

-- lfg queue ready
function events:LFG_PROPOSAL_SHOW(...)
 PlaySoundFile("Interface\\AddOns\\wake_up\\wake_up.ogg", "Master")
end

-- readycheck
function events:READY_CHECK(...)
 PlaySoundFile("Interface\\AddOns\\wake_up\\wake_up.ogg", "Master")
end

-- rolecheck
function events:ROLE_POLL_BEGIN(...)
 PlaySoundFile("Interface\\AddOns\\wake_up\\wake_up.ogg", "Master")
end

-- summon request
function events:CONFIRM_SUMMON(...)
 PlaySoundFile("Interface\\AddOns\\wake_up\\wake_up.ogg", "Master")
end

-- resurrect request
function events:RESURRECT_REQUEST(...)
 PlaySoundFile("Interface\\AddOns\\wake_up\\wake_up.ogg", "Master")
end

-- bg queue ready
function events:UPDATE_BATTLEFIELD_STATUS(...)
	local bgstatus = GetBattlefieldStatus(1)
	if (bgstatus == "confirm") then
		PlaySoundFile("Interface\\AddOns\\wake_up\\wake_up.ogg", "Master")
	end
end

-- tb/wg queue ready
function events:BATTLEFIELD_MGR_ENTRY_INVITE(...)
 PlaySoundFile("Interface\\AddOns\\wake_up\\wake_up.ogg", "Master")
end

-- requested inactive debuff alert for afkers in BG :D
function events:UNIT_AURA(...)
 if((UnitDebuff("player", "Inactive") or UnitDebuff("player", 43681)))
    then
		PlaySoundFile("Interface\\AddOns\\wake_up\\wake_up.ogg", "Master")
    end
end


-- #######################################################
-- end of events
-- #######################################################

frame:SetScript("OnEvent", function(self, event, ...)
 events[event](self, ...); 
end);
for k, v in pairs(events) do
 frame:RegisterEvent(k); 
end